<template>
    <el-container class="main-container">
        <el-header>
            <div class="header-content">
                <h2>管理系统</h2>
                <div class="user-info">
                    <span>欢迎您，{{ username }}</span>
                </div>
            </div>
        </el-header>
        
        <el-container>
            <el-aside width="200px">
                <el-menu
                    :router="true"
                    default-active="/main/home/1"
                    class="el-menu-vertical">
                    <el-menu-item index="/main/home/1">
                        <i class="el-icon-menu"></i>
                        <span>首页</span>
                    </el-menu-item>
                    <el-menu-item index="/main/users">
                        <i class="el-icon-document"></i>
                        <span>用户管理</span>
                    </el-menu-item>
                    <el-menu-item index="/main/settings">
                        <i class="el-icon-setting"></i>
                        <span>系统设置</span>
                    </el-menu-item>
                </el-menu>
            </el-aside>
            
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
export default {
    name: 'MainView',
    computed: {
        username() {
            return this.$route.query.username || 'admin'
        }
    }
}
</script>

<style scoped>
.main-container {
    height: 100vh;
}

.el-header {
    background-color: #409EFF;
    color: white;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.user-info {
    font-size: 14px;
}

.el-aside {
    background-color: #fff;
    border-right: solid 1px #e6e6e6;
}

.el-menu-vertical {
    border-right: none;
}
</style>
